FROM node:18  
  
# 安装系统依赖，支持图形界面  
RUN apt-get update && apt-get install -y \  
    python3 \  
    python3-pip \  
    python3-venv \  
    xvfb \  
    x11vnc \  
    fluxbox \  
    wget \  
    wmctrl \  
    && rm -rf /var/lib/apt/lists/*  
  
WORKDIR /app  
COPY . ./
# 复制package.json文件  
COPY package.json .  
COPY neuralagent-app/package.json ./neuralagent-app/  
  
# 安装Node.js依赖  
RUN npm install  
RUN cd neuralagent-app && npm install  
  
# 设置Python虚拟环境（aiagent）  
RUN cd aiagent && \  
    python3 -m venv venv && \  
    ./venv/bin/pip install pyautogui pillow mss requests pyperclip  
  
COPY . .  
  
EXPOSE 6763  
  
CMD ["npm", "start"]